www.gusucode.com > VC 自绘窗口标题栏、边框、系统按钮、最大化等-源码程序 > VC 自绘窗口标题栏、边框、系统按钮、最大化等-源码程序/code/youDlg.cpp

    //Download by http://www.NewXing.com
// youDlg.cpp : implementation file
//

#include "stdafx.h"
#include "TitleBar.h"
#include "youDlg.h"
#include "TitleBarDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CyouDlg dialog


CyouDlg::CyouDlg(CWnd* pParent /*=NULL*/)
	: CTitleBarDlg(pParent)
{
	//{{AFX_DATA_INIT(CyouDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CyouDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CyouDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CyouDlg, CDialog)
	//{{AFX_MSG_MAP(CyouDlg)
	ON_WM_NCLBUTTONDOWN()
	ON_WM_NCMOUSEMOVE()
	ON_WM_SYSCOMMAND()
	ON_WM_SIZE()
	ON_BN_CLICKED(IDC_BUTTON5, OnButton5)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CyouDlg message handlers

void CyouDlg::OnButton5() 
{
	// TODO: Add your control notification handler code here
	CDialog::OnCancel();
	
}

void CyouDlg::OnNcLButtonDown(UINT nHitTest, CPoint point)
{
	CTitleBarDlg::OnNcLButtonDown(nHitTest, point);
}

void CyouDlg::OnNcMouseMove(UINT nHitTest, CPoint point) 
{
	CTitleBarDlg::OnNcMouseMove(nHitTest, point); 
}
void CyouDlg::OnSize(UINT nType, int cx, int cy) 
{
	CTitleBarDlg::OnSize(nType, cx, cy); 
}

void CyouDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
	CTitleBarDlg::OnSysCommand(nID, lParam);
}